import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login/index.vue'
Vue.use(VueRouter)

const routes = [{
  path: '/',
  redirect: '/shouye'
}, {
  path: '/login',
  component: Login
}, {
  path: '/shouye',
  component: () => import('@/views/layout'),
  children: [{
    path: '/shouye', // 默认子路由
    component: () => import('@/views/home')
  },{
    path: '/qa', // 问答子路由
    component: () => import('@/views/wenda')
  },{
    path: '/video', // 视频子路由
    component: () => import('@/views/video')
  },{
    path: '/my', // 我的  子路由p
    component: () => import('@/views/my')
  }]
}]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
